QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Creating and Editing Polylines

QuickDraw 3D provides routines that you can use to create and manipulate polylines. See "Polylines" for the definition of a polyline.

Q3PolyLine_New

You can use the Q3PolyLine_New function to create a new polyline.

TQ3GeometryObject Q3PolyLine_New (
                     const TQ3PolyLineData *polyLineData);
polyLineData
A pointer to a TQ3PolyLineData structure.

DESCRIPTION

The Q3PolyLine_New function returns, as its function result, a new polyline having the vertices and attributes specified by the polyLineData parameter. If a new polyline could not be created, Q3PolyLine_New returns the value NULL .

Q3PolyLine_Submit

You can use the Q3PolyLine_Submit function to submit an immediate polyline for drawing, picking, bounding, or writing.

TQ3Status Q3PolyLine_Submit (
                     const TQ3PolyLineData *polyLineData,
                     TQ3ViewObject view);
polyLineData
A pointer to a TQ3PolyLineData structure.
view
A view.

DESCRIPTION

The Q3PolyLine_Submit function submits for drawing, picking, bounding, or writing the immediate polyline whose shape and attribute sets are specified by the polyLineData parameter. The polyline is drawn, picked, bounded, or written according to the view characteristics specified in the view parameter.

SPECIAL CONSIDERATIONS

You should call this function only in a submitting loop.

Q3PolyLine_GetData

You can use the Q3PolyLine_GetData function to get the data that defines a polyline and its attributes.

TQ3Status Q3PolyLine_GetData (
                     TQ3GeometryObject polyLine,
                     TQ3PolyLineData *polyLineData);
polyLine
A polyline.
polyLineData
On exit, a pointer to a TQ3PolyLineData structure that contains information about the polyline specified by the polyLine parameter.

DESCRIPTION

The Q3PolyLine_GetData function returns, through the polyLineData parameter, information about the polyline specified by the polyLine parameter. QuickDraw 3D allocates memory for the TQ3PolyLineData structure internally; you must call Q3PolyLine_EmptyData to dispose of that memory.

Q3PolyLine_SetData

You can use the Q3PolyLine_SetData function to set the data that defines a polyline and its attributes.

TQ3Status Q3PolyLine_SetData (
                     TQ3GeometryObject polyLine,
                     const TQ3PolyLineData *polyLineData);
polyLine
A polyline.
polyLineData
A pointer to a TQ3PolyLineData structure.

DESCRIPTION

The Q3PolyLine_SetData function sets the data associated with the polyline specified by the polyLine parameter to the data specified by the polyLineData parameter.

Q3PolyLine_EmptyData

You can use the Q3PolyLine_EmptyData function to release the memory occupied by the data structure returned by a previous call to Q3PolyLine_GetData .

TQ3Status Q3PolyLine_EmptyData (TQ3PolyLineData *polyLineData);
polyLineData
A pointer to a TQ3PolyLineData structure.

DESCRIPTION

The Q3PolyLine_EmptyData function releases the memory occupied by the TQ3PolyLineData structure pointed to by the polyLineData parameter; that memory was allocated by a previous call to Q3PolyLine_GetData .

Q3PolyLine_GetVertexPosition

You can use the Q3PolyLine_GetVertexPosition function to get the position of a vertex of a polyline.

TQ3Status Q3PolyLine_GetVertexPosition (
                     TQ3GeometryObject polyLine,
                     unsigned long index,
                     TQ3Point3D *position);
polyLine
A polyline.
index
An index into the vertices array of the specified polyline. This index should be greater than or equal to 0 and less than the number of vertices in the array.
position
On exit, the position of the specified vertex.

DESCRIPTION

The Q3PolyLine_GetVertexPosition function returns, in the position parameter, the position of the vertex having the index specified by the index parameter in the vertices array of the polyline specified by the polyLine parameter.

Q3PolyLine_SetVertexPosition

You can use the Q3PolyLine_SetVertexPosition function to set the position of a vertex of a polyline.

TQ3Status Q3PolyLine_SetVertexPosition (
                     TQ3GeometryObject polyLine,
                     unsigned long index,
                     const TQ3Point3D *position);
polyLine
A polyline.
index
An index into the vertices array of the specified polyline.
position
The desired position of the specified vertex.

DESCRIPTION

The Q3PolyLine_SetVertexPosition function sets the position of a vertex to that specified in the position parameter. The vertex has the index specified by the index parameter into the vertices array of the polyline specified by the polyLine parameter.

Q3PolyLine_GetVertexAttributeSet

You can use the Q3PolyLine_GetVertexAttributeSet function to get the attribute set of a vertex of a polyline.

TQ3Status Q3PolyLine_GetVertexAttributeSet (
                     TQ3GeometryObject polyLine,
                     unsigned long index,
                     TQ3AttributeSet *attributeSet);
polyLine
A polyline.
index
An index into the vertices array of the specified polyline.
attributeSet
On exit, a pointer to a vertex attribute set for the specified vertex.

DESCRIPTION

The Q3PolyLine_GetVertexAttributeSet function returns, in the attributeSet parameter, the set of attributes for the vertex having the index specified by the index parameter in the vertices array of the polyline specified by the polyLine parameter. The reference count of the set is incremented.

Q3PolyLine_SetVertexAttributeSet

You can use the Q3PolyLine_SetVertexAttributeSet function to set the attribute set of a vertex of a polyline.

TQ3Status Q3PolyLine_SetVertexAttributeSet (
                     TQ3GeometryObject polyLine,
                     unsigned long index,
                     TQ3AttributeSet attributeSet);
polyLine
A polyline.
index
An index into the vertices array of the specified polyline.
attributeSet
The desired set of attributes for the specified vertex.

DESCRIPTION

The Q3PolyLine_SetVertexAttributeSet function sets the attribute set of the vertex having the index specified by the index parameter in the vertices array of the polyline specified by the polyLine parameter to the set specified in the attributeSet parameter.

Q3PolyLine_GetSegmentAttributeSet

You can use the Q3PolyLine_GetSegmentAttributeSet function to get the attribute set of a segment of a polyline.

TQ3Status Q3PolyLine_GetSegmentAttributeSet (
                     TQ3GeometryObject polyLine,
                     unsigned long index,
                     TQ3AttributeSet *attributeSet);
polyLine
A polyline.
index
An index into the vertices array of the specified polyline.
attributeSet
On exit, a pointer to an attribute set for the specified segment.

DESCRIPTION

The Q3PolyLine_GetSegmentAttributeSet function returns, in the attributeSet parameter, the set of attributes for a segment of a polyline. The segment is defined by the two vertices having indices index and index +1 in the vertices array of the polyline specified by the polyLine parameter. The reference count of the set is incremented.

Q3PolyLine_SetSegmentAttributeSet

You can use the Q3PolyLine_SetSegmentAttributeSet function to set the attribute set of a segment of a polyline.

TQ3Status Q3PolyLine_SetSegmentAttributeSet (
                     TQ3GeometryObject polyLine,
                     unsigned long index,
                     TQ3AttributeSet attributeSet);
polyLine
A polyline.
index
An index into the vertices array of the specified polyline.
attributeSet
The desired set of attributes for the specified segment.

DESCRIPTION

The Q3PolyLine_SetSegmentAttributeSet function sets the attribute set of a segment of a polyline to the set specified in the attributeSet parameter. The segment is defined by the two vertices having indices index and index +1 in the vertices array of the polyline specified by the polyLine parameter.


© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |